package com.drm.netschool.mapper;

import com.drm.netschool.entity.DrmUserUlog;
import com.drm.netschool.entity.DrmUserUlogExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmUserUlogMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    int countByExample(DrmUserUlogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    int deleteByExample(DrmUserUlogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    @Delete({
        "delete from drm_user_ulog",
        "where user_id = #{userId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    @Insert({
        "insert into drm_user_ulog (user_id, article_cnt, ",
        "blog_cnt, recharge_sum, ",
        "study_ncnt, quiz_cnt, ",
        "lonin_cnt, browse_cnt, ",
        "share_cnt, buy_cnt, ",
        "login_log)",
        "values (#{userId,jdbcType=BIGINT}, #{articleCnt,jdbcType=INTEGER}, ",
        "#{blogCnt,jdbcType=INTEGER}, #{rechargeSum,jdbcType=BIGINT}, ",
        "#{studyNcnt,jdbcType=INTEGER}, #{quizCnt,jdbcType=INTEGER}, ",
        "#{loninCnt,jdbcType=INTEGER}, #{browseCnt,jdbcType=INTEGER}, ",
        "#{shareCnt,jdbcType=INTEGER}, #{buyCnt,jdbcType=INTEGER}, ",
        "#{loginLog,jdbcType=TIMESTAMP})"
    })
    int insert(DrmUserUlog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    int insertSelective(DrmUserUlog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    List<DrmUserUlog> selectByExample(DrmUserUlogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    @Select({
        "select",
        "user_id, article_cnt, blog_cnt, recharge_sum, study_ncnt, quiz_cnt, lonin_cnt, ",
        "browse_cnt, share_cnt, buy_cnt, login_log",
        "from drm_user_ulog",
        "where user_id = #{userId,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmUserUlog selectByPrimaryKey(Long userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmUserUlog record, @Param("example") DrmUserUlogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    int updateByExample(@Param("record") DrmUserUlog record, @Param("example") DrmUserUlogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    int updateByPrimaryKeySelective(DrmUserUlog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_ulog
     *
     * @mbggenerated Wed Aug 19 11:47:35 CST 2015
     */
    @Update({
        "update drm_user_ulog",
        "set article_cnt = #{articleCnt,jdbcType=INTEGER},",
          "blog_cnt = #{blogCnt,jdbcType=INTEGER},",
          "recharge_sum = #{rechargeSum,jdbcType=BIGINT},",
          "study_ncnt = #{studyNcnt,jdbcType=INTEGER},",
          "quiz_cnt = #{quizCnt,jdbcType=INTEGER},",
          "lonin_cnt = #{loninCnt,jdbcType=INTEGER},",
          "browse_cnt = #{browseCnt,jdbcType=INTEGER},",
          "share_cnt = #{shareCnt,jdbcType=INTEGER},",
          "buy_cnt = #{buyCnt,jdbcType=INTEGER},",
          "login_log = #{loginLog,jdbcType=TIMESTAMP}",
        "where user_id = #{userId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmUserUlog record);
}